home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / GPC2952B.ZIP / doc / gpc / docdemos / assigneddemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-02-09  |  317 b   |  20 lines

  1. program AssignedDemo;
  2. type
  3.   PInt = ^Integer;
  4.  
  5. procedure TellIfOdd (p: PInt);
  6. begin
  7.   if Assigned (p) and then Odd (p^) then
  8.     WriteLn ('The pointer p points to an odd value.')
  9. end;
  10.  
  11. var
  12.   foo: Integer;
  13. begin
  14.   TellIfOdd (nil);
  15.   foo := 1;
  16.   TellIfOdd (@foo);
  17.   foo := 2;
  18.   TellIfOdd (@foo)
  19. end.
  20.